home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.19950528-19950726
/
000016_news@columbia.edu_Wed May 31 23:35:16 1995.msg
< prev
next >
Wrap
Internet Message Format
|
2020-01-01
|
3KB
Received: from apakabar.cc.columbia.edu by watsun.cc.columbia.edu with SMTP id AA21873
(5.65c+CU/IDA-1.4.4/HLK for <kermit.misc@watsun.cc.columbia.edu>); Wed, 31 May 1995 19:35:23 -0400
Received: by apakabar.cc.columbia.edu id AA01252
(5.65c+CU/IDA-1.4.4/HLK for kermit.misc@watsun); Wed, 31 May 1995 19:35:21 -0400
Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
Newsgroups: comp.protocols.kermit.misc
Subject: Re: Piping output from "rem host" command
Date: 31 May 1995 23:35:16 GMT
Organization: Columbia University
Lines: 48
Message-Id: <3qiufk$16r@apakabar.cc.columbia.edu>
References: <Pine.PCP.3.91.950531154729.6366A-100000-100000-100000@[141.218.24.34]>
Nntp-Posting-Host: watsun.cc.columbia.edu
Apparently-To: kermit.misc@watsun.cc.columbia.edu
In article <Pine.PCP.3.91.950531154729.6366A-100000-100000-100000@[141.218.24.34]>,
John D. Tucker <tucker@mickey.acs.wmich.edu> wrote:
: I would like to send a command to a remote computer and capture a brief
: (one line of characters) response from that computer for processing
: within a script. Reading the "Using MS-DOS Kermit" manual, I found that
: rem host [command] > d:\log\remote.out
: would capture the output from "[command]" in the file "d:\log\remote.out".
: However, when using the pipe symbol (instead of the redirection symbol),
: the symbol gets sent to the remote host rather than piping the output to
: some program.
:
: Any suggestions how I could get the response from the remote computer
: into a Kermit script variable, piped to a DOS command/executable, or
: otherwise made available WITHOUT the intermediate step of writing to a file?
: Even dumping the entire contents of the communications buffer would work
: as I could probably filter out what I want.
:
This is a tough one. Obviously, you COULD redirect to a DOS file and then
read the file into an MS-DOS Kermit variable with OPEN READ, READ, CLOSE
READ. But there is no general mechanism for getting arbitrary text from the
server into a variable on the client. However, there is something close:
the REMOTE QUERY command. If the text on the server side can be obtained
from a built-in Kermit variable, a user-defined variable, or an environment
variable, then REMOTE QUERY can get it. But there is no way, currently, of
getting arbitrary text (the standard output of a program or command) into
one of these variables. You would like to be able to do something like
this (assuming the host was UNIX):
remote assign \%a `command arg arg ...`
remote query user \%a
but this presently can't be done. Similarly:
remote host FOO=`command arg arg ...`
remote query system FOO
can't be done because the environment variable disappears as soon as it
is set (rules about manipulating superior processes).
This is an idea for a future release of Kermit. Perhaps something like:
\fsystem(text)
runs the system command "text" and returns its standard output. But this
will be a bit tricky, since the standard output could be any length at all,
even gigabytes...
- Frank